
import {gpVisitScenePv,gpVisitFrontPv} from '@/api/visitScenePv'
//场景访问量-添加访问量
export function gpScenePv(sceneCode='JZ'){
  return new Promise((resolve, reject) => {
    let userFrom = uni.getStorageSync('tag') || '1'
    gpVisitScenePv({sceneCode,userFrom}).then(res=>{
      const {code,message} = res
      if(code===200){
        resolve(code)
      } else {
        uni.showToast({
          title:message,
          duration:2000,
          mask:true,
          icon:false,
        })
        reject(res)
      }
    })
  })
}
//阵地访问量-添加访问量
export function gpFrontPv({frontCode,frontName}){
  return new Promise((resolve, reject) => {
    gpVisitFrontPv({frontCode,frontName}).then(res=>{
      const {code,message} = res
      if(code===200){
        resolve(code)
      } else {
        uni.showToast({
          title:message,
          duration:2000,
          mask:true,
          icon:false,
        })
        reject(res)
      }
    })
  })
}
